<?php

class Event_model extends Model{

	var $table_name = 'event';
	
	function Event_model()
	{
		parent::Model();
	}
	
	function get_row($field,$where_field = '',$where_value = '')
	{
		$this->db->select($field);	
		if($where_value<>''):
			$this->db->where($where_field,$where_value);
		endif;
		$this->db->where('status','A');
		$query = $this->db->get($this->table_name);	
		return $query;
	}
	
	function get_rows($field,$where_field = '',$where_value = '',$show= '',$start= '')
	{
		$this->db->select($field);	
		if($where_value<>''):
			$this->db->where($where_field,$where_value);
			
		endif;
		if($show > 0)
		{
			$this->db->limit($show,$start);	
		}
		$this->db->where('status','A');
		$this->db->orderby('start_date','DESC');
		$query = $this->db->get($this->table_name);	
		return $query;
	}
	
	function get_rows_home($field)
	{
		$this->db->select($field);	
		$this->db->where('status','A');
		$this->db->orderby('start_date','DESC');
		$this->db->limit(3);	
		$query = $this->db->get($this->table_name);	
		return $query;
		
	}	
	
}

/* End of file event_model.php */
?>